package com.bc.bczbweb.controller.Ajax;

import com.bc.commonentity.common.JsonResult;
import com.bc.bcapi.service.T_Common_report_typeService;
import com.bc.bcmodel.domain.T_Common_report_typeModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.ws.rs.POST;
import java.math.BigInteger;

@RestController
@RequestMapping("ajax/t_common_report_type")
public class AjaxT_Common_report_typeController {
    @Autowired
    T_Common_report_typeService t_Common_report_typeService;

    @POST
    @RequestMapping(value = "add", method = RequestMethod.POST)
    public JsonResult add(T_Common_report_typeModel req) {
        JsonResult js = new JsonResult();
        if (req.getId() != null && req.getId().intValue() > 0) {
            t_Common_report_typeService.update(req);
        } else {
            t_Common_report_typeService.insert(req);
        }
        return js;
    }

    @RequestMapping("del")
    public JsonResult del(BigInteger id) {
        JsonResult js = new JsonResult();
        t_Common_report_typeService.delete(id);
        return js;
    }
}